package cn.kn.sys.controller;

import cn.kn.common.model.R;
import cn.kn.sys.service.RecourcesService;
import cn.kn.sys.vo.MenuVo;
import cn.kn.sys.vo.NodeVo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author WangJiang
 * @create 2020-12-09 10:13
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/sys/resources")
public class RecouresController {
    private final RecourcesService recourcesService;

    @GetMapping("prems")
    public R<List<NodeVo>> prems(){
        return recourcesService.prems();
    }

    @GetMapping("{roleId}")
    public R<List<Long>> getResByRoleId(@PathVariable Long roleId){
        return recourcesService.getResByRoleId(roleId);
    }


    @GetMapping("menu")
    public R<List<MenuVo>> menus(){
        return recourcesService.menus();
    }


}
